|
![](/i/fill.gif) |
Pabs wrote in message <38F3D600.A087CAF2@hotmail.com>...
>"Mr. Art" wrote:
>
>> This short bit of code shows how to use a
>> planetary image as a displacement map on a sphere.
>> I know that this is displacement mapping only on a
>> sphere, but the same concept should work on other shapes.
>> I hope that this helps.
>
>I was thinking more along the lines of a patch which used isosurfaces to
>implement displacement mapping
How about the following code:
#declare AnObject = union{
sphere{<0,0,0>,1}
torus{1.3,0.5}
}
#declare AnObjectFunc = pigment{
object{
AnObject
}
color rgb 0, color rgb 1
}
isosurface{
function{AnObjectFunc+noise3d(x,y,z)}
contained_by{box{min_extent(AnObject),max_extent(AnObject)}
method 2
max_gradient 100
pigment{rgb 1}
}
I can't guarentee that this will work on the first try, but it will displace
the surface of any object using the noise3d function. To use a different
object, just replace AnObject with the object you want.
Mark
Post a reply to this message
|
![](/i/fill.gif) |